package chapter03;

public class recursion {

        static int calculate(int n) {
            if (n == 0) {
                return 1;
            } else {
                return (n * calculate(n - 1));
            }
        }

        public static void main(String[] args) {
            int n = 5;
            System.out.println(n + "! = " + calculate(n));
        }

}
